package Day19;

/**
 * @author hyhWTX
 * @version 1.0
 * @date 2022年03月19日 16:12
 */


public class Circle implements Shape{
    private final double PI = 3.14;  //圆周率
    private double r;   //半径

    public double getR() {
        return r;
    }
    public void setR(double r) {
        this.r = r;
    }
    public Circle(double r) {
        this.r = r;
    }
    @Override
    public double getArea() {
        return PI*r*r;
    }

    @Override
    public double getPerimeter() {
        return PI*r*2;
    }
}
